package com.jysz.certificate.persistence.enums;
/**
 * 释放单状态
 * @author xuxiaolong
 */
public enum CertificateRenewState {

	NOSTART("暂存", 0),SUBMITED("已提交", 1),PASSED("已通过", 2),REFUSED("已退回", 3), FINISH("已完成", 6);   
	   
    //名称
    private String name;
    //索引
    private int index;   
    private CertificateRenewState(String name, int index) {   
        this.name = name;   
        this.index = index;   
    }   
    
    //根据索引获得名称
    public static String getName(int index) {   
        for (CertificateRenewState r : CertificateRenewState.values()) {   
            if (r.getIndex() == index) {   
                return r.name;   
            }   
        }   
        return null;   
    }
    
    public static CertificateRenewState index(int index){   
        for (CertificateRenewState r : CertificateRenewState.values()) {   
            if (r.getIndex() == index) {   
                return r;   
            }   
        }   
        return null;   
    }
    public String getName() {   
        return name;   
    }   
    public void setName(String name) {   
        this.name = name;   
    }   
    public int getIndex() {   
        return index;   
    }   
    public void setIndex(int index) {   
        this.index = index;   
    }   

}
